#include<iostream>
#include<cmath>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int arr[110];
    for (int i = 1; i <= n+1; i++)
    {
        cin >> arr[i];
    }
    
    int i = 1;
    while (n >= 0)
    {


        if (arr[i] == 0)
        {
            i++; n--;
            continue;
        }

        if (i == 1)
        {
            if (arr[1] < 0) cout << "-";
            if (arr[1] > 0);
        }
        else
        {
            if (arr[i] > 0)
            {
                cout << "+";
            }
            else if (arr[i] < 0)
                cout << "-";
        }
        if (abs(arr[i] == 1) && n != 0);
        else if (abs(arr[i]) == 1 && n == 0)
            cout << abs(arr[i]);


       
        if (arr[i] > 0 && abs(arr[i])!=1)
            cout << abs(arr[i]);
        else if (arr[i] < 0  &&  abs(arr[i])!=1)
            cout << abs(arr[i]);

        if (n == 1)
            cout << "x";
        else if (n == 0)
            ;
        else
            cout << "x^" << n;


        n--;
        i++;
    }
    return 0;
}